/*
*静态链表
*@author 寇戈
*@version 1.0 , 2021-10-1
*/
#include <iostream>
#include "myhead.h"
#include <malloc.h>

using namespace std;

#define MAXSIZE 100
typedef struct
{
    ElemType data;
    int cur;
} component, SLinklist[MAXSIZE];

int LocateElem_SL(SLinklist S, ElemType e)
{
    /*
    *查找元素返回下标
    *T(n)=O(n)
    */

    int i = S[0].cur;
    while (i && S[i].data != e)
        i = S[i].cur;
    return i;
}
